package com.yudean.esb.dao.mds;

import com.yudean.esb.domain.mds.MdsIntIndex;
import com.yudean.esb.mapper.mds.MdsIntIndexMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Repository
public class MdsIntIndexDao {
    @Resource
    private MdsIntIndexMapper mdsIntIndexMapper;

    public List<MdsIntIndex> getMdsIntIndexByPeriodDate(Date periodDate, String compCode) {

        List<MdsIntIndex> list = mdsIntIndexMapper.getMdsIntIndexByPeriodDate(periodDate, compCode);
        if (list == null || list.size() < 1) {
            return null;
        }
        return list;
    }

    public List<MdsIntIndex> getMdsIntIndexByPeriod(Date periodStartDate,
                                                    Date periodEndDate,
                                                    String periodType,
                                                    String compCode) {

        List<MdsIntIndex> list = mdsIntIndexMapper.getMdsIntIndexByPeriod(periodStartDate, periodEndDate, periodType, compCode);
        if (list == null || list.size() < 1) {
            return null;
        }
        return list;
    }
}
